package com.sky.mapper.user;

import com.sky.pojo.AddressBook;
import io.swagger.models.auth.In;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface AddressBookServiceMapper {
    void insertAddressBook(AddressBook addressBook);

    List<AddressBook> queryAddressBookList(Long userId);

    AddressBook queryAddressBookId(Long id);

    void updateAddressBook(AddressBook addressBook);

    void deleteAddressBook(Long id);

    List<AddressBook>  queryAcquiesceAddressBook(Long userId,Integer isDefault);

    void setAcquiesceAddressBook(Long id, Integer isDefault);


    AddressBook queryAddressBookUserId(Long userId, Integer isDefault);

    @Update("update address_book set is_default=#{notDefault} where user_id=#{userId}")
    void CleanAcquiesceAddressBook(Long userId, Integer notDefault);
}
